<template>
	<view class="withdrawal-success">
		<g-navbar title="申请成功" />
		<steps :stepList="stepList" :current="1" style="margin-top: 48rpx;" />
		<image class="status-icon"
			src="https://mp-a6359cef-e1f5-4478-96f8-00fab19c712c.cdn.bspapp.com/cloudstorage/817452a2-c4d5-4f7e-95c0-fce2f33802c6.png" />
		<view class="title">
			提现申请成功
		</view>
		<view class="time">
			预计{{withdrawalStatus.reach_time}}前到账
		</view>
		<view class="detail-wrapper">
			<view class="detail-item">
				<view class="label">
					提现金额
				</view>
				<view class="value">
					￥{{withdrawalStatus.amount}}
				</view>
			</view>
			<view class="detail-item">
				<view class="label">
					到账方式
				</view>
				<view class="value">
					{{withdrawalStatus.withdrawal_type}}
				</view>
			</view>
		</view>
		<g-button btn_text="确定" :height="104" style="margin-top: 104rpx;" @click="jump"/>
	</view>
</template>

<script lang="ts" setup>
	import steps from '@/components/steps/index.vue';
	import { IStep } from '@/components/steps/types';
	import { onLoad } from '@dcloudio/uni-app';
	import { WITHDRAWAL_VALUE } from '@/enum/withdrawal';
	import { Ref, ref, reactive } from "vue";
	const stepList : IStep[] = [
		{
			value: '发起提现',
			icon: 'certification'
		},
		{
			value: '处理中',
			icon: 'review'
		},
		{
			value: '到账成功',
			icon: 'review-success'
		}
	]

	interface IWithdrawalStatus {
		amount : string;
		reach_time : string;
		withdrawal_type : WITHDRAWAL_VALUE
	}

	const withdrawalStatus : IWithdrawalStatus = reactive({
		amount:'0.00',
		reach_time:'',
		withdrawal_type:WITHDRAWAL_VALUE.WECHAT
	});

	onLoad((e) => {
		withdrawalStatus.amount = e!.amount;
		withdrawalStatus.reach_time = e!.reach_time;
		withdrawalStatus.withdrawal_type = e!.withdrawal_type;
	})
	
	const jump = ()=>{
		uni.router.route('/pages/home/home')
	}
</script>

<style scoped lang="scss">
	@import "./withdrawalSuccess.scss";
</style>